<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="/jquery/jquery-2.1.3.js"></script>
    <script src="/common/common.js"></script>
    <script src="/bootstrap/js/bootstrap.min.js"></script></head>
<body>
<div class="container">
    <section class="loginBox row-fluid">
        <section class="span7 left">
            <h2>用户登录</h2>
            <p><input type="text" id="username" placeholder="用户名"/></p>
            <p><input type="text" id="password" placeholder="密码"/></p>
            <section class="row-fluid">
                <section class="span1"><input type="button" value=" 登录 " class="btn btn-primary" onclick="login()"></section>
            </section>
        </section>
        <section class="span5 right">
            <h2>没有帐户？</h2>
            <section>
                <p>请点这个注册一个吧</p>
                <p><input type="button" value=" 注册 " class="btn regBtn" onclick="toRegist()"></p>
            </section>
        </section>
    </section><!-- /loginBox -->
</div> <!-- /container -->
</body>
<script>
    function login(){
        var username = $("#username").val();
        var password = $("#password").val();
        if(username==null||password==null||username==""||password==""){
            alert('请输入用户名密码!');
        }else{
            var param = new Object();
            param.username = username;
            param.password = password;
            var data = postContent("/doLogin",param,false,null);
            if(data!=null){
                window.location.href = "/show.html";
            }
        }
    }
    function toRegist(){
        window.location.href = "/regist.html";
    }
</script>
</html>
